/**
 * 
 */
package com.noisyair.android.alvin.apps.sms;

import java.sql.Date;
import java.text.SimpleDateFormat;

/**
 * This Class represents a Text Message. It has fields
 * for the message body, sender name and date (property
 * formatted for presentation).
 */

public class TextMessage {
	String mMessage;
	String mName;
	String mDate;
	String mNumber;
	boolean mWasRead;
	String mNameID;
	String mMessageID;
	String mMessageThreadID;
	
	SimpleDateFormat sdf = new SimpleDateFormat("EEE, MMM d, h:mm a");

	public TextMessage(){
		mMessage = "Unknown";
		mName = "Unknown";
		mDate = "Unknown";
		mNumber = "Unknown";
		mWasRead = false;
		mNameID = "unknown";
		mMessageThreadID = "Unknown";
	}
	
	public TextMessage(String message, String name, long date){
		mMessage = message;
		mName = name;
		Date d = new Date(date);
		mDate = sdf.format(d);		
	}
	
	public String getMMessage() {
		return mMessage;
	}

	public void setMMessage(String message) {
		mMessage = message;
	}

	public String getMName() {
		return mName;
	}

	public void setMName(String name) {
		mName = name;
	}

	public String getDate() {
		return mDate;
	}

	public void setDate(long date) {
		Date theDate = new Date(date);		
		mDate = sdf.format(theDate);
	}
	
	public void setNumber(String number){
		mNumber = number;
	}
	
	public String getNumber(){
		return mNumber;
	}
	
	public boolean wasRead(){
		return mWasRead;
	}
	
	public void wasRead(String result){
		if(result.equals("1")){
			mWasRead = true;
		}
		else{
			mWasRead = false;
		}
	}
	
	public void wasRead(boolean result){
		mWasRead = result;
	}
	
	public void setNameID(String id){
		mNameID = id;
	}
	
	public String getNameID(){
		return mNameID;
	}
	
	public void setMessageID(String id){
		mMessageID = id;
	}
	
	public String getMessageID(){
		return mMessageID;
	}
	
	public void setMessageThreadID(String id){
		mMessageThreadID = id;
	}
	
	public String getMessageThreadID(){
		return mMessageThreadID;
	}
}
